import request from "@/utils/request";
import { baseURL } from "@/config/settings";

const downloadTemplateURL =
  baseURL + "/resourcevisualization/excel/downloadTemplate/";

const downloadResourceDataURL =
  baseURL + "/resourcevisualization/excel/downloadResourceData/";

export { downloadTemplateURL, downloadResourceDataURL };

export function importResourceData(data) {
  return request({
    url: "/resourcevisualization/excel/importResourceData",
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data",
    },
    data,
  });
}

export function downloadSelectedResourceData(data) {
  return request({
    url: "/resourcevisualization/excel/downloadSelectedResourceData",
    method: "post",
    responseType: "blob",
    data,
  });
}

export function downloadTemplate(data) {
  return request({
    url: "/resourcevisualization/excel/downloadTemplate/" + data,
    method: "get",
    responseType: "blob",
  });
}

export function downloadResourceData(data) {
  return request({
    url: "/resourcevisualization/excel/downloadResourceData/" + data,
    method: "get",
    responseType: "blob",
  });
}
